home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / triton / examples / toolmanager3.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-01-01  |  4.0 KB  |  167 lines

  1. Program ToolManager3;
  2.  
  3. (*
  4.  *  OpenTriton -- A free release of the triton.library source code
  5.  *  Copyright (C) 1993-1998  Stefan Zeiger
  6.  *
  7.  *  This program is free software; you can redistribute it and/or modify
  8.  *  it under the terms of the GNU General Public License as published by
  9.  *  the Free Software Foundation; either version 2 of the License, or
  10.  *  (at your option) any later version.
  11.  *
  12.  *  This program is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *  GNU General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU General Public License
  18.  *  along with this program; if not, write to the Free Software
  19.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *  Toolmanager3.c - My own creation for a ToolManager GUI
  22.  *
  23.  *)
  24.  
  25.  
  26. uses exec, triton, tritonmacros,utility, linklist, vartags;
  27.  
  28. {
  29.    A demo in FPC Pascal using triton.library
  30.  
  31.    nils.sjoholm@mailbox.swipnet.se
  32. }
  33.  
  34.  
  35.  
  36.  
  37. const
  38.      cycle_entries : array [0..7] of pchar = ('Exec','Image','Sound','Menu','Icon','Dock','Access',NIL);
  39.  
  40.      liststrings : array [0..8] of pchar = (
  41.                      '2024view' ,
  42.                      'Add to archive',
  43.                      'Delete',
  44.                      'Edit text',
  45.                      'Env',
  46.                      'Exchange',
  47.                      'Global Help System',
  48.                      'Multiview',
  49.                      'Paint');
  50.  
  51. var
  52.    i : Longint;
  53.    LVList : pList;
  54.    MyNode : pFPCNode;
  55.    Triton_App : pTr_App;
  56.  
  57. procedure CleanUp(why : string; err : longint);
  58. begin
  59.      if assigned(Triton_App) then TR_DeleteApp(triton_App);
  60.      if assigned(LVList) then DestroyList(LVList);
  61.      if why <> '' then writeln(why);
  62.      halt(err);
  63. end;
  64.  
  65. begin
  66.     CreateList(LVList);
  67.     FOR i := 0 TO 8 DO BEGIN
  68.         MyNode := AddNewNode(LVList,liststrings[i]);
  69.     END;
  70.  
  71.  
  72.     Triton_App := TR_CreateApp(TAGS(
  73.                                TRCA_Name,longstr('ToolManagerGUIDemo3'),
  74.                                TRCA_LongName,longstr('ToolManager GUI demo 3'),
  75.                                TRCA_Info,longstr('My own creation for a ToolManager GUI'),
  76.                                TAG_END));
  77.  
  78.     if Triton_App = nil then CleanUp('Can''t create application',20);
  79.  
  80.       ProjectStart;
  81.       WindowID(1); WindowPosition(TRWP_CENTERDISPLAY);
  82.       WindowTitle('ToolManager GUI demo 3');
  83.  
  84.       VertGroupA;
  85.  
  86.         Space;
  87.  
  88.         HorizGroupAC;
  89.           Space;
  90.           TextID('_Object type',1);
  91.           Space;
  92.           CycleGadget(@cycle_entries,0,1);
  93.           Space;
  94.         EndGroup;
  95.  
  96.         Space;
  97.  
  98.         NamedSeparatorI('Object _list',2);
  99.  
  100.         Space;
  101.  
  102.         HorizGroupAC;
  103.           Space;
  104.             VertGroupAC;
  105.               ListSS(LVList,2,0,0);
  106.               HorizGroupEA;
  107.                 Button('_New...',8);
  108.                 Button('_Edit...',9);
  109.               EndGroup;
  110.               HorizGroupEA;
  111.                 Button('Co_py',10);
  112.                 Button('Remove',11);
  113.               EndGroup;
  114.             EndGroup;
  115.           Space;
  116.           Line(TROF_VERT);
  117.           Space;
  118.             SetTRTag(TRGR_Vert, TRGR_ALIGN OR TRGR_FIXHORIZ);
  119.               Button('Top',3);
  120.               Space;
  121.               Button('Up',4);
  122.               Space;
  123.               Button('Down',5);
  124.               Space;
  125.               Button('Bottom',6);
  126.               VertGroupS;Space;EndGroup;
  127.               Button('So_rt',7);
  128.             EndGroup;
  129.           Space;
  130.         EndGroup;
  131.  
  132.         Space;
  133.  
  134.         HorizSeparator;
  135.  
  136.         Space;
  137.  
  138.         HorizGroup;
  139.           Space;
  140.           HorizGroupS;
  141.             Button('_Save',12);
  142.             Space;
  143.             Button('_Use',13);
  144.             Space;
  145.             Button('_Test',14);
  146.             Space;
  147.             Button('_Cancel',15);
  148.           EndGroup;
  149.           Space;
  150.         EndGroup;
  151.  
  152.         Space;
  153.  
  154.       EndGroup;
  155.  
  156.       EndProject;
  157.  
  158.     i := TR_AutoRequest(Triton_App,NIL,@tritontags);
  159.   CleanUp('',0);
  160. end.
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.